package com.atguigu.gmall.feign.seckill;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.seckill.entity.SeckillGoods;
import com.atguigu.gmall.seckill.vo.SeckillOrderConfirmVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient("service-seckill")
@RequestMapping("/api/inner/rpc/seckill")
public interface SeckillFeignClient {

    @ApiOperation("查询当天参与秒杀的所有商品")
    @GetMapping("/today/goods")
    public Result<List<SeckillGoods>> getTodaySeckillGoods();

    @ApiOperation("查询秒杀商品详情")
    @GetMapping("/detail/{skuId}")
    public Result<SeckillGoods> getSeckillGoodsDetail(@PathVariable("skuId") Long skuId);

    @ApiOperation("获取秒杀单数据")
    @GetMapping("/order/detail/{code}")
    public Result<SeckillOrderConfirmVo> getSeckillOrderInfo(@PathVariable("code") String code);
}
